package com.wulis.seckill.business.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.wulis.seckill.business.mapper.UserInfoMapper;
import com.wulis.seckill.business.pojo.UserInfo;
import com.wulis.seckill.business.service.UserInfoService;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

@Service
@AllArgsConstructor
@Slf4j
public class UserInfoServiceImpl
        extends ServiceImpl<UserInfoMapper, UserInfo> implements UserInfoService {
    private final UserInfoMapper userInfoMapper;

    public UserInfo getUserInfo(String account) {
        return userInfoMapper.selectOne(
                new QueryWrapper<UserInfo>().lambda()
                        .eq(UserInfo::getAccount, account)
                        .eq(UserInfo::getDeleteFlag, "1")
        );
    }
}
